Subscription Management API
The Subscription Management API provides administrators and resellers with the ability to manage user subscriptions, including removing subscriptions, reverting changes, and adjusting subscription durations.
Overview
This API provides three main operations:
- Remove User Subscription
- Revert Last Subscription Change
- Revert to Specific Days
Authorization
important
These mutations require authentication and proper authorization. Only administrators and resellers can perform these operations. Resellers can only manage subscriptions for their own users.
API Reference
Remove User Subscription
Completely removes a user's subscription from the system.
mutation RemoveSubscription($username: String!) {
removeUserSubscription(username: $username) {
id
expiresAt
group {
id
name
}
multiLoginCount
dailyBandwidth
downloadUpload
isTrialPeriod
duration
price
gateway
}
}
Variables
{
"username": "test@example.com"
}
Response
{
"data": {
"removeUserSubscription": {
"id": 123,
"expiresAt": "2024-12-31T23:59:59",
"group": {
"id": 1,
"name": "Premium"
},
"multiLoginCount": 5,
"dailyBandwidth": 1000000000,
"downloadUpload": 100000000,
"isTrialPeriod": false,
"duration": 30,
"price": 9.99,
"gateway": "STRIPE"
}
}
}
Revert Last Subscription Change
Reverts to previous subscription state while maintaining the remaining time.
mutation RevertSubscription($username: String!) {
revertLastSubscriptionChange(username: $username) {
id
expiresAt
group {
id
name
}
multiLoginCount
dailyBandwidth
downloadUpload
isTrialPeriod
duration
price
gateway
}
}